import socket

client = socket.socket()
client.connect(("localhost", 8081))
while True:
    msg = input(">>:").strip()
    if len(msg) == 0 : continue  # 没有输入跳过
    client.send(msg.encode())
    data = client.recv(1024)
    print("接受数据", data.decode('utf-8'))
client.close()
